<?php

namespace app\api\controller;

use app\common\model\news\NewsCategory as NewsCategoryModel;
use app\common\model\news\News as Newsodel;
use app\common\model\other\Armedpolice as ArmedpoliceModel;
use app\common\model\other\Network as NetworkModel;
use app\common\model\Slide as SlideModel;
use app\common\model\other\Friendship as FriendshipModel;
use app\common\model\other\Notice as NoticeModel;
use app\common\model\other\FlashCategory as FlashCategoryModel;
use app\common\model\other\Topic as TopicModel;
use app\common\model\other\Deeply as DeeplyModel;
use app\common\model\other\NewspapersCategory as NewspapersCategoryModel;
use app\common\model\other\Tool as ToolModel;
use app\common\model\other\Study as StudyModel;
use app\common\model\Config;
use app\common\controller\Api;

/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 首页头部数据
     *
     * @ApiMethod (GET)
     */
    public function head()
    {
        //栏目

        //$list['news_category_list']=NewsCategoryModel::getList();
        $list['column']=NewsCategoryModel::geFathertList();
//        $list['column'][1]=['name'=>'强军铸魂','data'=>MilitaryCategoryModel::getList()];
//        $list['column'][2]=['name'=>'强军智库','data'=>ThinksCategoryModel::getList()];
//        $list['column'][3]=['name'=>'练兵备战','data'=>TroopCategoryModel::getList()];
//        $list['column'][4]=['name'=>'加油文化','data'=>CultureCategoryModel::getList()];
        //网站配置
        $list['config']=Config::getList();
        //武警导航
        $list['armedpolice']=ArmedpoliceModel::getList();
        //军网导航
        $list['network']=NetworkModel::getList();
        //轮播
        $list['slide']=SlideModel::getList();


        $this->success('请求成功',$list);
    }

    /**
     * 首页底部部数据
     *
     * @ApiMethod (GET)
     */
    public function foot()
    {
        $list=[];
        $list['column']=NewsCategoryModel::geFathertList();
        $list['config']=Config::getList();
        //友情链接
        $list['friendship']=FriendshipModel::getList();
        $this->success('请求成功',$list);
    }

    /**
     * 获取列表
     *
     * @ApiMethod (GET)
     */
    public function news()
    {
        $list=Newsodel::getRecommend();

        $this->success('请求成功',$list);
    }


    /**
     * 支队要闻
     *
     * @ApiMethod (GET)
     */
    public function detachment()
    {
        $list=NewsCategoryModel::getListId(13);

        $this->success('请求成功',$list);
    }


    /**
     * 通知公告
     *
     * @ApiMethod (GET)
     */
    public function notice()
    {
        $list=NoticeModel::getList();

        $this->success('请求成功',$list);
    }

    /**
     * 通知公告
     *
     * @ApiMethod (GET)
     */
    public function suspensionnotice()
    {
        $list=NoticeModel::suspensionnotice();
        $this->success('请求成功',$list);
    }

    /**
     * 通知公告
     *
     * @ApiMethod (GET)
     */
    public function flashCategory()
    {
        $list=FlashCategoryModel::getList();

        $this->success('请求成功',$list);
    }
    /**
     * 专题策划
     *
     * @ApiMethod (GET)
     */
    public function topic()
    {
        $list=TopicModel::getList();

        $this->success('请求成功',$list);
    }

    /**
     * 六座连心桥
     *
     * @ApiMethod (GET)
     */
    public function deeply()
    {
        $list=DeeplyModel::getList();

        $this->success('请求成功',$list);
    }
    /**
     * 官兵风采
     *
     * @ApiMethod (GET)
     */
    public function demeanour()
    {
        $list=Newsodel::getListId(39);

        $this->success('请求成功',$list);
    }
    /**
     * 拥政爱民
     *
     * @ApiMethod (GET)
     */
    public function lovepeople()
    {
        $list=Newsodel::getListId(40);

        $this->success('请求成功',$list);
    }


    /**
     * 一队一品
     *
     * @ApiMethod (GET)
     */
    public function oneteam()
    {
        $list=Newsodel::getListId(36);

        $this->success('请求成功',$list);
    }

    /**
     * 天天读报
     *
     * @ApiMethod (GET)
     */
    public function newspapersCategory()
    {
        $list=NewspapersCategoryModel::getList();

        $this->success('请求成功',$list);
    }

    /**
     * 常用工具
     *
     * @ApiMethod (GET)
     */
    public function utilities()
    {
        $list=ToolModel::getList();

        $this->success('请求成功',$list);
    }

    public function study()
    {
        $list=StudyModel::getList();

        $this->success('请求成功',$list);
    }


}
